package oa.hleast.xswl.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

/**
 * @author 00209
 * @desc 订单来源类型枚举
 * @email dz@hleast.com
 * @Date 2021/03/01 22:01:45
 */
@ToString
@AllArgsConstructor
public enum PayTypeEnum {

    WEIXIN(1,"微信支付"),
    ALIPAY(2,"支付宝支付"),
    BALANCE(3,"会员余额支付"),
    POINT(4,"积分支付")
    ;
    @Getter
    private Integer code;

    @Getter
    private String text;

    public static PayTypeEnum getByCode(Integer code){
        for (PayTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
